/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
/**
 * Autogenerated by Thrift Compiler (0.11.0)
 *
 * <p>DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *
 * @generated
 */
package org.apache.pegasus.apps;

import org.apache.pegasus.base.blob;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(
    value = "Autogenerated by Thrift Compiler (0.11.0)",
    date = "2020-04-13")
public class multi_get_request
    implements org.apache.thrift.TBase<multi_get_request, multi_get_request._Fields>,
        java.io.Serializable,
        Cloneable,
        Comparable<multi_get_request> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC =
      new org.apache.thrift.protocol.TStruct("multi_get_request");

  private static final org.apache.thrift.protocol.TField HASH_KEY_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "hash_key", org.apache.thrift.protocol.TType.STRUCT, (short) 1);
  private static final org.apache.thrift.protocol.TField SORK_KEYS_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "sork_keys", org.apache.thrift.protocol.TType.LIST, (short) 2);
  private static final org.apache.thrift.protocol.TField MAX_KV_COUNT_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "max_kv_count", org.apache.thrift.protocol.TType.I32, (short) 3);
  private static final org.apache.thrift.protocol.TField MAX_KV_SIZE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "max_kv_size", org.apache.thrift.protocol.TType.I32, (short) 4);
  private static final org.apache.thrift.protocol.TField NO_VALUE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "no_value", org.apache.thrift.protocol.TType.BOOL, (short) 5);
  private static final org.apache.thrift.protocol.TField START_SORTKEY_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "start_sortkey", org.apache.thrift.protocol.TType.STRUCT, (short) 6);
  private static final org.apache.thrift.protocol.TField STOP_SORTKEY_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "stop_sortkey", org.apache.thrift.protocol.TType.STRUCT, (short) 7);
  private static final org.apache.thrift.protocol.TField START_INCLUSIVE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "start_inclusive", org.apache.thrift.protocol.TType.BOOL, (short) 8);
  private static final org.apache.thrift.protocol.TField STOP_INCLUSIVE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "stop_inclusive", org.apache.thrift.protocol.TType.BOOL, (short) 9);
  private static final org.apache.thrift.protocol.TField SORT_KEY_FILTER_TYPE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "sort_key_filter_type", org.apache.thrift.protocol.TType.I32, (short) 10);
  private static final org.apache.thrift.protocol.TField SORT_KEY_FILTER_PATTERN_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "sort_key_filter_pattern", org.apache.thrift.protocol.TType.STRUCT, (short) 11);
  private static final org.apache.thrift.protocol.TField REVERSE_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "reverse", org.apache.thrift.protocol.TType.BOOL, (short) 12);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
      new multi_get_requestStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
      new multi_get_requestTupleSchemeFactory();

  public blob hash_key; // required
  public java.util.List<blob> sork_keys; // required
  public int max_kv_count; // required
  public int max_kv_size; // required
  public boolean no_value; // required
  public blob start_sortkey; // required
  public blob stop_sortkey; // required
  public boolean start_inclusive; // required
  public boolean stop_inclusive; // required
  /** @see filter_type */
  public filter_type sort_key_filter_type; // required

  public blob sort_key_filter_pattern; // required
  public boolean reverse; // required

  /**
   * The set of fields this struct contains, along with convenience methods for finding and
   * manipulating them.
   */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    HASH_KEY((short) 1, "hash_key"),
    SORK_KEYS((short) 2, "sork_keys"),
    MAX_KV_COUNT((short) 3, "max_kv_count"),
    MAX_KV_SIZE((short) 4, "max_kv_size"),
    NO_VALUE((short) 5, "no_value"),
    START_SORTKEY((short) 6, "start_sortkey"),
    STOP_SORTKEY((short) 7, "stop_sortkey"),
    START_INCLUSIVE((short) 8, "start_inclusive"),
    STOP_INCLUSIVE((short) 9, "stop_inclusive"),
    /** @see filter_type */
    SORT_KEY_FILTER_TYPE((short) 10, "sort_key_filter_type"),
    SORT_KEY_FILTER_PATTERN((short) 11, "sort_key_filter_pattern"),
    REVERSE((short) 12, "reverse");

    private static final java.util.Map<java.lang.String, _Fields> byName =
        new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /** Find the _Fields constant that matches fieldId, or null if its not found. */
    public static _Fields findByThriftId(int fieldId) {
      switch (fieldId) {
        case 1: // HASH_KEY
          return HASH_KEY;
        case 2: // SORK_KEYS
          return SORK_KEYS;
        case 3: // MAX_KV_COUNT
          return MAX_KV_COUNT;
        case 4: // MAX_KV_SIZE
          return MAX_KV_SIZE;
        case 5: // NO_VALUE
          return NO_VALUE;
        case 6: // START_SORTKEY
          return START_SORTKEY;
        case 7: // STOP_SORTKEY
          return STOP_SORTKEY;
        case 8: // START_INCLUSIVE
          return START_INCLUSIVE;
        case 9: // STOP_INCLUSIVE
          return STOP_INCLUSIVE;
        case 10: // SORT_KEY_FILTER_TYPE
          return SORT_KEY_FILTER_TYPE;
        case 11: // SORT_KEY_FILTER_PATTERN
          return SORT_KEY_FILTER_PATTERN;
        case 12: // REVERSE
          return REVERSE;
        default:
          return null;
      }
    }

    /** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null)
        throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /** Find the _Fields constant that matches name, or null if its not found. */
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __MAX_KV_COUNT_ISSET_ID = 0;
  private static final int __MAX_KV_SIZE_ISSET_ID = 1;
  private static final int __NO_VALUE_ISSET_ID = 2;
  private static final int __START_INCLUSIVE_ISSET_ID = 3;
  private static final int __STOP_INCLUSIVE_ISSET_ID = 4;
  private static final int __REVERSE_ISSET_ID = 5;
  private byte __isset_bitfield = 0;
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;

  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap =
        new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(
        _Fields.HASH_KEY,
        new org.apache.thrift.meta_data.FieldMetaData(
            "hash_key",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.StructMetaData(
                org.apache.thrift.protocol.TType.STRUCT, blob.class)));
    tmpMap.put(
        _Fields.SORK_KEYS,
        new org.apache.thrift.meta_data.FieldMetaData(
            "sork_keys",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.ListMetaData(
                org.apache.thrift.protocol.TType.LIST,
                new org.apache.thrift.meta_data.StructMetaData(
                    org.apache.thrift.protocol.TType.STRUCT, blob.class))));
    tmpMap.put(
        _Fields.MAX_KV_COUNT,
        new org.apache.thrift.meta_data.FieldMetaData(
            "max_kv_count",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(
        _Fields.MAX_KV_SIZE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "max_kv_size",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(
        _Fields.NO_VALUE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "no_value",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(
        _Fields.START_SORTKEY,
        new org.apache.thrift.meta_data.FieldMetaData(
            "start_sortkey",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.StructMetaData(
                org.apache.thrift.protocol.TType.STRUCT, blob.class)));
    tmpMap.put(
        _Fields.STOP_SORTKEY,
        new org.apache.thrift.meta_data.FieldMetaData(
            "stop_sortkey",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.StructMetaData(
                org.apache.thrift.protocol.TType.STRUCT, blob.class)));
    tmpMap.put(
        _Fields.START_INCLUSIVE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "start_inclusive",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(
        _Fields.STOP_INCLUSIVE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "stop_inclusive",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(
        _Fields.SORT_KEY_FILTER_TYPE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "sort_key_filter_type",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.EnumMetaData(
                org.apache.thrift.protocol.TType.ENUM, filter_type.class)));
    tmpMap.put(
        _Fields.SORT_KEY_FILTER_PATTERN,
        new org.apache.thrift.meta_data.FieldMetaData(
            "sort_key_filter_pattern",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.StructMetaData(
                org.apache.thrift.protocol.TType.STRUCT, blob.class)));
    tmpMap.put(
        _Fields.REVERSE,
        new org.apache.thrift.meta_data.FieldMetaData(
            "reverse",
            org.apache.thrift.TFieldRequirementType.DEFAULT,
            new org.apache.thrift.meta_data.FieldValueMetaData(
                org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(
        multi_get_request.class, metaDataMap);
  }

  public multi_get_request() {}

  public multi_get_request(
      blob hash_key,
      java.util.List<blob> sork_keys,
      int max_kv_count,
      int max_kv_size,
      boolean no_value,
      blob start_sortkey,
      blob stop_sortkey,
      boolean start_inclusive,
      boolean stop_inclusive,
      filter_type sort_key_filter_type,
      blob sort_key_filter_pattern,
      boolean reverse) {
    this();
    this.hash_key = hash_key;
    this.sork_keys = sork_keys;
    this.max_kv_count = max_kv_count;
    setMax_kv_countIsSet(true);
    this.max_kv_size = max_kv_size;
    setMax_kv_sizeIsSet(true);
    this.no_value = no_value;
    setNo_valueIsSet(true);
    this.start_sortkey = start_sortkey;
    this.stop_sortkey = stop_sortkey;
    this.start_inclusive = start_inclusive;
    setStart_inclusiveIsSet(true);
    this.stop_inclusive = stop_inclusive;
    setStop_inclusiveIsSet(true);
    this.sort_key_filter_type = sort_key_filter_type;
    this.sort_key_filter_pattern = sort_key_filter_pattern;
    this.reverse = reverse;
    setReverseIsSet(true);
  }

  /** Performs a deep copy on <i>other</i>. */
  public multi_get_request(multi_get_request other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetHash_key()) {
      this.hash_key = new blob(other.hash_key);
    }
    if (other.isSetSork_keys()) {
      java.util.List<blob> __this__sork_keys =
          new java.util.ArrayList<blob>(other.sork_keys.size());
      for (blob other_element : other.sork_keys) {
        __this__sork_keys.add(new blob(other_element));
      }
      this.sork_keys = __this__sork_keys;
    }
    this.max_kv_count = other.max_kv_count;
    this.max_kv_size = other.max_kv_size;
    this.no_value = other.no_value;
    if (other.isSetStart_sortkey()) {
      this.start_sortkey = new blob(other.start_sortkey);
    }
    if (other.isSetStop_sortkey()) {
      this.stop_sortkey = new blob(other.stop_sortkey);
    }
    this.start_inclusive = other.start_inclusive;
    this.stop_inclusive = other.stop_inclusive;
    if (other.isSetSort_key_filter_type()) {
      this.sort_key_filter_type = other.sort_key_filter_type;
    }
    if (other.isSetSort_key_filter_pattern()) {
      this.sort_key_filter_pattern = new blob(other.sort_key_filter_pattern);
    }
    this.reverse = other.reverse;
  }

  public multi_get_request deepCopy() {
    return new multi_get_request(this);
  }

  @Override
  public void clear() {
    this.hash_key = null;
    this.sork_keys = null;
    setMax_kv_countIsSet(false);
    this.max_kv_count = 0;
    setMax_kv_sizeIsSet(false);
    this.max_kv_size = 0;
    setNo_valueIsSet(false);
    this.no_value = false;
    this.start_sortkey = null;
    this.stop_sortkey = null;
    setStart_inclusiveIsSet(false);
    this.start_inclusive = false;
    setStop_inclusiveIsSet(false);
    this.stop_inclusive = false;
    this.sort_key_filter_type = null;
    this.sort_key_filter_pattern = null;
    setReverseIsSet(false);
    this.reverse = false;
  }

  public blob getHash_key() {
    return this.hash_key;
  }

  public multi_get_request setHash_key(blob hash_key) {
    this.hash_key = hash_key;
    return this;
  }

  public void unsetHash_key() {
    this.hash_key = null;
  }

  /** Returns true if field hash_key is set (has been assigned a value) and false otherwise */
  public boolean isSetHash_key() {
    return this.hash_key != null;
  }

  public void setHash_keyIsSet(boolean value) {
    if (!value) {
      this.hash_key = null;
    }
  }

  public int getSork_keysSize() {
    return (this.sork_keys == null) ? 0 : this.sork_keys.size();
  }

  public java.util.Iterator<blob> getSork_keysIterator() {
    return (this.sork_keys == null) ? null : this.sork_keys.iterator();
  }

  public void addToSork_keys(blob elem) {
    if (this.sork_keys == null) {
      this.sork_keys = new java.util.ArrayList<blob>();
    }
    this.sork_keys.add(elem);
  }

  public java.util.List<blob> getSork_keys() {
    return this.sork_keys;
  }

  public multi_get_request setSork_keys(java.util.List<blob> sork_keys) {
    this.sork_keys = sork_keys;
    return this;
  }

  public void unsetSork_keys() {
    this.sork_keys = null;
  }

  /** Returns true if field sork_keys is set (has been assigned a value) and false otherwise */
  public boolean isSetSork_keys() {
    return this.sork_keys != null;
  }

  public void setSork_keysIsSet(boolean value) {
    if (!value) {
      this.sork_keys = null;
    }
  }

  public int getMax_kv_count() {
    return this.max_kv_count;
  }

  public multi_get_request setMax_kv_count(int max_kv_count) {
    this.max_kv_count = max_kv_count;
    setMax_kv_countIsSet(true);
    return this;
  }

  public void unsetMax_kv_count() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_KV_COUNT_ISSET_ID);
  }

  /** Returns true if field max_kv_count is set (has been assigned a value) and false otherwise */
  public boolean isSetMax_kv_count() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_KV_COUNT_ISSET_ID);
  }

  public void setMax_kv_countIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_KV_COUNT_ISSET_ID, value);
  }

  public int getMax_kv_size() {
    return this.max_kv_size;
  }

  public multi_get_request setMax_kv_size(int max_kv_size) {
    this.max_kv_size = max_kv_size;
    setMax_kv_sizeIsSet(true);
    return this;
  }

  public void unsetMax_kv_size() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_KV_SIZE_ISSET_ID);
  }

  /** Returns true if field max_kv_size is set (has been assigned a value) and false otherwise */
  public boolean isSetMax_kv_size() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_KV_SIZE_ISSET_ID);
  }

  public void setMax_kv_sizeIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_KV_SIZE_ISSET_ID, value);
  }

  public boolean isNo_value() {
    return this.no_value;
  }

  public multi_get_request setNo_value(boolean no_value) {
    this.no_value = no_value;
    setNo_valueIsSet(true);
    return this;
  }

  public void unsetNo_value() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NO_VALUE_ISSET_ID);
  }

  /** Returns true if field no_value is set (has been assigned a value) and false otherwise */
  public boolean isSetNo_value() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NO_VALUE_ISSET_ID);
  }

  public void setNo_valueIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NO_VALUE_ISSET_ID, value);
  }

  public blob getStart_sortkey() {
    return this.start_sortkey;
  }

  public multi_get_request setStart_sortkey(blob start_sortkey) {
    this.start_sortkey = start_sortkey;
    return this;
  }

  public void unsetStart_sortkey() {
    this.start_sortkey = null;
  }

  /** Returns true if field start_sortkey is set (has been assigned a value) and false otherwise */
  public boolean isSetStart_sortkey() {
    return this.start_sortkey != null;
  }

  public void setStart_sortkeyIsSet(boolean value) {
    if (!value) {
      this.start_sortkey = null;
    }
  }

  public blob getStop_sortkey() {
    return this.stop_sortkey;
  }

  public multi_get_request setStop_sortkey(blob stop_sortkey) {
    this.stop_sortkey = stop_sortkey;
    return this;
  }

  public void unsetStop_sortkey() {
    this.stop_sortkey = null;
  }

  /** Returns true if field stop_sortkey is set (has been assigned a value) and false otherwise */
  public boolean isSetStop_sortkey() {
    return this.stop_sortkey != null;
  }

  public void setStop_sortkeyIsSet(boolean value) {
    if (!value) {
      this.stop_sortkey = null;
    }
  }

  public boolean isStart_inclusive() {
    return this.start_inclusive;
  }

  public multi_get_request setStart_inclusive(boolean start_inclusive) {
    this.start_inclusive = start_inclusive;
    setStart_inclusiveIsSet(true);
    return this;
  }

  public void unsetStart_inclusive() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID);
  }

  /**
   * Returns true if field start_inclusive is set (has been assigned a value) and false otherwise
   */
  public boolean isSetStart_inclusive() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID);
  }

  public void setStart_inclusiveIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __START_INCLUSIVE_ISSET_ID, value);
  }

  public boolean isStop_inclusive() {
    return this.stop_inclusive;
  }

  public multi_get_request setStop_inclusive(boolean stop_inclusive) {
    this.stop_inclusive = stop_inclusive;
    setStop_inclusiveIsSet(true);
    return this;
  }

  public void unsetStop_inclusive() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID);
  }

  /** Returns true if field stop_inclusive is set (has been assigned a value) and false otherwise */
  public boolean isSetStop_inclusive() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID);
  }

  public void setStop_inclusiveIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STOP_INCLUSIVE_ISSET_ID, value);
  }

  /** @see filter_type */
  public filter_type getSort_key_filter_type() {
    return this.sort_key_filter_type;
  }

  /** @see filter_type */
  public multi_get_request setSort_key_filter_type(filter_type sort_key_filter_type) {
    this.sort_key_filter_type = sort_key_filter_type;
    return this;
  }

  public void unsetSort_key_filter_type() {
    this.sort_key_filter_type = null;
  }

  /**
   * Returns true if field sort_key_filter_type is set (has been assigned a value) and false
   * otherwise
   */
  public boolean isSetSort_key_filter_type() {
    return this.sort_key_filter_type != null;
  }

  public void setSort_key_filter_typeIsSet(boolean value) {
    if (!value) {
      this.sort_key_filter_type = null;
    }
  }

  public blob getSort_key_filter_pattern() {
    return this.sort_key_filter_pattern;
  }

  public multi_get_request setSort_key_filter_pattern(blob sort_key_filter_pattern) {
    this.sort_key_filter_pattern = sort_key_filter_pattern;
    return this;
  }

  public void unsetSort_key_filter_pattern() {
    this.sort_key_filter_pattern = null;
  }

  /**
   * Returns true if field sort_key_filter_pattern is set (has been assigned a value) and false
   * otherwise
   */
  public boolean isSetSort_key_filter_pattern() {
    return this.sort_key_filter_pattern != null;
  }

  public void setSort_key_filter_patternIsSet(boolean value) {
    if (!value) {
      this.sort_key_filter_pattern = null;
    }
  }

  public boolean isReverse() {
    return this.reverse;
  }

  public multi_get_request setReverse(boolean reverse) {
    this.reverse = reverse;
    setReverseIsSet(true);
    return this;
  }

  public void unsetReverse() {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __REVERSE_ISSET_ID);
  }

  /** Returns true if field reverse is set (has been assigned a value) and false otherwise */
  public boolean isSetReverse() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __REVERSE_ISSET_ID);
  }

  public void setReverseIsSet(boolean value) {
    __isset_bitfield =
        org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __REVERSE_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, java.lang.Object value) {
    switch (field) {
      case HASH_KEY:
        if (value == null) {
          unsetHash_key();
        } else {
          setHash_key((blob) value);
        }
        break;

      case SORK_KEYS:
        if (value == null) {
          unsetSork_keys();
        } else {
          setSork_keys((java.util.List<blob>) value);
        }
        break;

      case MAX_KV_COUNT:
        if (value == null) {
          unsetMax_kv_count();
        } else {
          setMax_kv_count((java.lang.Integer) value);
        }
        break;

      case MAX_KV_SIZE:
        if (value == null) {
          unsetMax_kv_size();
        } else {
          setMax_kv_size((java.lang.Integer) value);
        }
        break;

      case NO_VALUE:
        if (value == null) {
          unsetNo_value();
        } else {
          setNo_value((java.lang.Boolean) value);
        }
        break;

      case START_SORTKEY:
        if (value == null) {
          unsetStart_sortkey();
        } else {
          setStart_sortkey((blob) value);
        }
        break;

      case STOP_SORTKEY:
        if (value == null) {
          unsetStop_sortkey();
        } else {
          setStop_sortkey((blob) value);
        }
        break;

      case START_INCLUSIVE:
        if (value == null) {
          unsetStart_inclusive();
        } else {
          setStart_inclusive((java.lang.Boolean) value);
        }
        break;

      case STOP_INCLUSIVE:
        if (value == null) {
          unsetStop_inclusive();
        } else {
          setStop_inclusive((java.lang.Boolean) value);
        }
        break;

      case SORT_KEY_FILTER_TYPE:
        if (value == null) {
          unsetSort_key_filter_type();
        } else {
          setSort_key_filter_type((filter_type) value);
        }
        break;

      case SORT_KEY_FILTER_PATTERN:
        if (value == null) {
          unsetSort_key_filter_pattern();
        } else {
          setSort_key_filter_pattern((blob) value);
        }
        break;

      case REVERSE:
        if (value == null) {
          unsetReverse();
        } else {
          setReverse((java.lang.Boolean) value);
        }
        break;
    }
  }

  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
      case HASH_KEY:
        return getHash_key();

      case SORK_KEYS:
        return getSork_keys();

      case MAX_KV_COUNT:
        return getMax_kv_count();

      case MAX_KV_SIZE:
        return getMax_kv_size();

      case NO_VALUE:
        return isNo_value();

      case START_SORTKEY:
        return getStart_sortkey();

      case STOP_SORTKEY:
        return getStop_sortkey();

      case START_INCLUSIVE:
        return isStart_inclusive();

      case STOP_INCLUSIVE:
        return isStop_inclusive();

      case SORT_KEY_FILTER_TYPE:
        return getSort_key_filter_type();

      case SORT_KEY_FILTER_PATTERN:
        return getSort_key_filter_pattern();

      case REVERSE:
        return isReverse();
    }
    throw new java.lang.IllegalStateException();
  }

  /**
   * Returns true if field corresponding to fieldID is set (has been assigned a value) and false
   * otherwise
   */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
      case HASH_KEY:
        return isSetHash_key();
      case SORK_KEYS:
        return isSetSork_keys();
      case MAX_KV_COUNT:
        return isSetMax_kv_count();
      case MAX_KV_SIZE:
        return isSetMax_kv_size();
      case NO_VALUE:
        return isSetNo_value();
      case START_SORTKEY:
        return isSetStart_sortkey();
      case STOP_SORTKEY:
        return isSetStop_sortkey();
      case START_INCLUSIVE:
        return isSetStart_inclusive();
      case STOP_INCLUSIVE:
        return isSetStop_inclusive();
      case SORT_KEY_FILTER_TYPE:
        return isSetSort_key_filter_type();
      case SORT_KEY_FILTER_PATTERN:
        return isSetSort_key_filter_pattern();
      case REVERSE:
        return isSetReverse();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that == null) return false;
    if (that instanceof multi_get_request) return this.equals((multi_get_request) that);
    return false;
  }

  public boolean equals(multi_get_request that) {
    if (that == null) return false;
    if (this == that) return true;

    boolean this_present_hash_key = true && this.isSetHash_key();
    boolean that_present_hash_key = true && that.isSetHash_key();
    if (this_present_hash_key || that_present_hash_key) {
      if (!(this_present_hash_key && that_present_hash_key)) return false;
      if (!this.hash_key.equals(that.hash_key)) return false;
    }

    boolean this_present_sork_keys = true && this.isSetSork_keys();
    boolean that_present_sork_keys = true && that.isSetSork_keys();
    if (this_present_sork_keys || that_present_sork_keys) {
      if (!(this_present_sork_keys && that_present_sork_keys)) return false;
      if (!this.sork_keys.equals(that.sork_keys)) return false;
    }

    boolean this_present_max_kv_count = true;
    boolean that_present_max_kv_count = true;
    if (this_present_max_kv_count || that_present_max_kv_count) {
      if (!(this_present_max_kv_count && that_present_max_kv_count)) return false;
      if (this.max_kv_count != that.max_kv_count) return false;
    }

    boolean this_present_max_kv_size = true;
    boolean that_present_max_kv_size = true;
    if (this_present_max_kv_size || that_present_max_kv_size) {
      if (!(this_present_max_kv_size && that_present_max_kv_size)) return false;
      if (this.max_kv_size != that.max_kv_size) return false;
    }

    boolean this_present_no_value = true;
    boolean that_present_no_value = true;
    if (this_present_no_value || that_present_no_value) {
      if (!(this_present_no_value && that_present_no_value)) return false;
      if (this.no_value != that.no_value) return false;
    }

    boolean this_present_start_sortkey = true && this.isSetStart_sortkey();
    boolean that_present_start_sortkey = true && that.isSetStart_sortkey();
    if (this_present_start_sortkey || that_present_start_sortkey) {
      if (!(this_present_start_sortkey && that_present_start_sortkey)) return false;
      if (!this.start_sortkey.equals(that.start_sortkey)) return false;
    }

    boolean this_present_stop_sortkey = true && this.isSetStop_sortkey();
    boolean that_present_stop_sortkey = true && that.isSetStop_sortkey();
    if (this_present_stop_sortkey || that_present_stop_sortkey) {
      if (!(this_present_stop_sortkey && that_present_stop_sortkey)) return false;
      if (!this.stop_sortkey.equals(that.stop_sortkey)) return false;
    }

    boolean this_present_start_inclusive = true;
    boolean that_present_start_inclusive = true;
    if (this_present_start_inclusive || that_present_start_inclusive) {
      if (!(this_present_start_inclusive && that_present_start_inclusive)) return false;
      if (this.start_inclusive != that.start_inclusive) return false;
    }

    boolean this_present_stop_inclusive = true;
    boolean that_present_stop_inclusive = true;
    if (this_present_stop_inclusive || that_present_stop_inclusive) {
      if (!(this_present_stop_inclusive && that_present_stop_inclusive)) return false;
      if (this.stop_inclusive != that.stop_inclusive) return false;
    }

    boolean this_present_sort_key_filter_type = true && this.isSetSort_key_filter_type();
    boolean that_present_sort_key_filter_type = true && that.isSetSort_key_filter_type();
    if (this_present_sort_key_filter_type || that_present_sort_key_filter_type) {
      if (!(this_present_sort_key_filter_type && that_present_sort_key_filter_type)) return false;
      if (!this.sort_key_filter_type.equals(that.sort_key_filter_type)) return false;
    }

    boolean this_present_sort_key_filter_pattern = true && this.isSetSort_key_filter_pattern();
    boolean that_present_sort_key_filter_pattern = true && that.isSetSort_key_filter_pattern();
    if (this_present_sort_key_filter_pattern || that_present_sort_key_filter_pattern) {
      if (!(this_present_sort_key_filter_pattern && that_present_sort_key_filter_pattern))
        return false;
      if (!this.sort_key_filter_pattern.equals(that.sort_key_filter_pattern)) return false;
    }

    boolean this_present_reverse = true;
    boolean that_present_reverse = true;
    if (this_present_reverse || that_present_reverse) {
      if (!(this_present_reverse && that_present_reverse)) return false;
      if (this.reverse != that.reverse) return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetHash_key()) ? 131071 : 524287);
    if (isSetHash_key()) hashCode = hashCode * 8191 + hash_key.hashCode();

    hashCode = hashCode * 8191 + ((isSetSork_keys()) ? 131071 : 524287);
    if (isSetSork_keys()) hashCode = hashCode * 8191 + sork_keys.hashCode();

    hashCode = hashCode * 8191 + max_kv_count;

    hashCode = hashCode * 8191 + max_kv_size;

    hashCode = hashCode * 8191 + ((no_value) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetStart_sortkey()) ? 131071 : 524287);
    if (isSetStart_sortkey()) hashCode = hashCode * 8191 + start_sortkey.hashCode();

    hashCode = hashCode * 8191 + ((isSetStop_sortkey()) ? 131071 : 524287);
    if (isSetStop_sortkey()) hashCode = hashCode * 8191 + stop_sortkey.hashCode();

    hashCode = hashCode * 8191 + ((start_inclusive) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((stop_inclusive) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetSort_key_filter_type()) ? 131071 : 524287);
    if (isSetSort_key_filter_type()) hashCode = hashCode * 8191 + sort_key_filter_type.getValue();

    hashCode = hashCode * 8191 + ((isSetSort_key_filter_pattern()) ? 131071 : 524287);
    if (isSetSort_key_filter_pattern())
      hashCode = hashCode * 8191 + sort_key_filter_pattern.hashCode();

    hashCode = hashCode * 8191 + ((reverse) ? 131071 : 524287);

    return hashCode;
  }

  @Override
  public int compareTo(multi_get_request other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetHash_key()).compareTo(other.isSetHash_key());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHash_key()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hash_key, other.hash_key);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetSork_keys()).compareTo(other.isSetSork_keys());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSork_keys()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sork_keys, other.sork_keys);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetMax_kv_count()).compareTo(other.isSetMax_kv_count());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMax_kv_count()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.max_kv_count, other.max_kv_count);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetMax_kv_size()).compareTo(other.isSetMax_kv_size());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMax_kv_size()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_kv_size, other.max_kv_size);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetNo_value()).compareTo(other.isSetNo_value());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNo_value()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.no_value, other.no_value);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetStart_sortkey()).compareTo(other.isSetStart_sortkey());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStart_sortkey()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.start_sortkey, other.start_sortkey);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetStop_sortkey()).compareTo(other.isSetStop_sortkey());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStop_sortkey()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.stop_sortkey, other.stop_sortkey);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetStart_inclusive()).compareTo(other.isSetStart_inclusive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStart_inclusive()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.start_inclusive, other.start_inclusive);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetStop_inclusive()).compareTo(other.isSetStop_inclusive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStop_inclusive()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.stop_inclusive, other.stop_inclusive);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetSort_key_filter_type())
            .compareTo(other.isSetSort_key_filter_type());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSort_key_filter_type()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.sort_key_filter_type, other.sort_key_filter_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        java.lang.Boolean.valueOf(isSetSort_key_filter_pattern())
            .compareTo(other.isSetSort_key_filter_pattern());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSort_key_filter_pattern()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.sort_key_filter_pattern, other.sort_key_filter_pattern);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetReverse()).compareTo(other.isSetReverse());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReverse()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reverse, other.reverse);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot)
      throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("multi_get_request(");
    boolean first = true;

    sb.append("hash_key:");
    if (this.hash_key == null) {
      sb.append("null");
    } else {
      sb.append(this.hash_key);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("sork_keys:");
    if (this.sork_keys == null) {
      sb.append("null");
    } else {
      sb.append(this.sork_keys);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("max_kv_count:");
    sb.append(this.max_kv_count);
    first = false;
    if (!first) sb.append(", ");
    sb.append("max_kv_size:");
    sb.append(this.max_kv_size);
    first = false;
    if (!first) sb.append(", ");
    sb.append("no_value:");
    sb.append(this.no_value);
    first = false;
    if (!first) sb.append(", ");
    sb.append("start_sortkey:");
    if (this.start_sortkey == null) {
      sb.append("null");
    } else {
      sb.append(this.start_sortkey);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("stop_sortkey:");
    if (this.stop_sortkey == null) {
      sb.append("null");
    } else {
      sb.append(this.stop_sortkey);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("start_inclusive:");
    sb.append(this.start_inclusive);
    first = false;
    if (!first) sb.append(", ");
    sb.append("stop_inclusive:");
    sb.append(this.stop_inclusive);
    first = false;
    if (!first) sb.append(", ");
    sb.append("sort_key_filter_type:");
    if (this.sort_key_filter_type == null) {
      sb.append("null");
    } else {
      sb.append(this.sort_key_filter_type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("sort_key_filter_pattern:");
    if (this.sort_key_filter_pattern == null) {
      sb.append("null");
    } else {
      sb.append(this.sort_key_filter_pattern);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("reverse:");
    sb.append(this.reverse);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (hash_key != null) {
      hash_key.validate();
    }
    if (start_sortkey != null) {
      start_sortkey.validate();
    }
    if (stop_sortkey != null) {
      stop_sortkey.validate();
    }
    if (sort_key_filter_pattern != null) {
      sort_key_filter_pattern.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(
          new org.apache.thrift.protocol.TCompactProtocol(
              new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in)
      throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and
      // doesn't call the default constructor.
      __isset_bitfield = 0;
      read(
          new org.apache.thrift.protocol.TCompactProtocol(
              new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class multi_get_requestStandardSchemeFactory
      implements org.apache.thrift.scheme.SchemeFactory {
    public multi_get_requestStandardScheme getScheme() {
      return new multi_get_requestStandardScheme();
    }
  }

  private static class multi_get_requestStandardScheme
      extends org.apache.thrift.scheme.StandardScheme<multi_get_request> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, multi_get_request struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // HASH_KEY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.hash_key = new blob();
              struct.hash_key.read(iprot);
              struct.setHash_keyIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SORK_KEYS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
                struct.sork_keys = new java.util.ArrayList<blob>(_list16.size);
                blob _elem17;
                for (int _i18 = 0; _i18 < _list16.size; ++_i18) {
                  _elem17 = new blob();
                  _elem17.read(iprot);
                  struct.sork_keys.add(_elem17);
                }
                iprot.readListEnd();
              }
              struct.setSork_keysIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // MAX_KV_COUNT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.max_kv_count = iprot.readI32();
              struct.setMax_kv_countIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // MAX_KV_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.max_kv_size = iprot.readI32();
              struct.setMax_kv_sizeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // NO_VALUE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.no_value = iprot.readBool();
              struct.setNo_valueIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // START_SORTKEY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.start_sortkey = new blob();
              struct.start_sortkey.read(iprot);
              struct.setStart_sortkeyIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // STOP_SORTKEY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.stop_sortkey = new blob();
              struct.stop_sortkey.read(iprot);
              struct.setStop_sortkeyIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // START_INCLUSIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.start_inclusive = iprot.readBool();
              struct.setStart_inclusiveIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // STOP_INCLUSIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.stop_inclusive = iprot.readBool();
              struct.setStop_inclusiveIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // SORT_KEY_FILTER_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.sort_key_filter_type = filter_type.findByValue(iprot.readI32());
              struct.setSort_key_filter_typeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // SORT_KEY_FILTER_PATTERN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.sort_key_filter_pattern = new blob();
              struct.sort_key_filter_pattern.read(iprot);
              struct.setSort_key_filter_patternIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // REVERSE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.reverse = iprot.readBool();
              struct.setReverseIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, multi_get_request struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.hash_key != null) {
        oprot.writeFieldBegin(HASH_KEY_FIELD_DESC);
        struct.hash_key.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.sork_keys != null) {
        oprot.writeFieldBegin(SORK_KEYS_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.sork_keys.size()));
          for (blob _iter19 : struct.sork_keys) {
            _iter19.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(MAX_KV_COUNT_FIELD_DESC);
      oprot.writeI32(struct.max_kv_count);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(MAX_KV_SIZE_FIELD_DESC);
      oprot.writeI32(struct.max_kv_size);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(NO_VALUE_FIELD_DESC);
      oprot.writeBool(struct.no_value);
      oprot.writeFieldEnd();
      if (struct.start_sortkey != null) {
        oprot.writeFieldBegin(START_SORTKEY_FIELD_DESC);
        struct.start_sortkey.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.stop_sortkey != null) {
        oprot.writeFieldBegin(STOP_SORTKEY_FIELD_DESC);
        struct.stop_sortkey.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(START_INCLUSIVE_FIELD_DESC);
      oprot.writeBool(struct.start_inclusive);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(STOP_INCLUSIVE_FIELD_DESC);
      oprot.writeBool(struct.stop_inclusive);
      oprot.writeFieldEnd();
      if (struct.sort_key_filter_type != null) {
        oprot.writeFieldBegin(SORT_KEY_FILTER_TYPE_FIELD_DESC);
        oprot.writeI32(struct.sort_key_filter_type.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.sort_key_filter_pattern != null) {
        oprot.writeFieldBegin(SORT_KEY_FILTER_PATTERN_FIELD_DESC);
        struct.sort_key_filter_pattern.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(REVERSE_FIELD_DESC);
      oprot.writeBool(struct.reverse);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
  }

  private static class multi_get_requestTupleSchemeFactory
      implements org.apache.thrift.scheme.SchemeFactory {
    public multi_get_requestTupleScheme getScheme() {
      return new multi_get_requestTupleScheme();
    }
  }

  private static class multi_get_requestTupleScheme
      extends org.apache.thrift.scheme.TupleScheme<multi_get_request> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, multi_get_request struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot =
          (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetHash_key()) {
        optionals.set(0);
      }
      if (struct.isSetSork_keys()) {
        optionals.set(1);
      }
      if (struct.isSetMax_kv_count()) {
        optionals.set(2);
      }
      if (struct.isSetMax_kv_size()) {
        optionals.set(3);
      }
      if (struct.isSetNo_value()) {
        optionals.set(4);
      }
      if (struct.isSetStart_sortkey()) {
        optionals.set(5);
      }
      if (struct.isSetStop_sortkey()) {
        optionals.set(6);
      }
      if (struct.isSetStart_inclusive()) {
        optionals.set(7);
      }
      if (struct.isSetStop_inclusive()) {
        optionals.set(8);
      }
      if (struct.isSetSort_key_filter_type()) {
        optionals.set(9);
      }
      if (struct.isSetSort_key_filter_pattern()) {
        optionals.set(10);
      }
      if (struct.isSetReverse()) {
        optionals.set(11);
      }
      oprot.writeBitSet(optionals, 12);
      if (struct.isSetHash_key()) {
        struct.hash_key.write(oprot);
      }
      if (struct.isSetSork_keys()) {
        {
          oprot.writeI32(struct.sork_keys.size());
          for (blob _iter20 : struct.sork_keys) {
            _iter20.write(oprot);
          }
        }
      }
      if (struct.isSetMax_kv_count()) {
        oprot.writeI32(struct.max_kv_count);
      }
      if (struct.isSetMax_kv_size()) {
        oprot.writeI32(struct.max_kv_size);
      }
      if (struct.isSetNo_value()) {
        oprot.writeBool(struct.no_value);
      }
      if (struct.isSetStart_sortkey()) {
        struct.start_sortkey.write(oprot);
      }
      if (struct.isSetStop_sortkey()) {
        struct.stop_sortkey.write(oprot);
      }
      if (struct.isSetStart_inclusive()) {
        oprot.writeBool(struct.start_inclusive);
      }
      if (struct.isSetStop_inclusive()) {
        oprot.writeBool(struct.stop_inclusive);
      }
      if (struct.isSetSort_key_filter_type()) {
        oprot.writeI32(struct.sort_key_filter_type.getValue());
      }
      if (struct.isSetSort_key_filter_pattern()) {
        struct.sort_key_filter_pattern.write(oprot);
      }
      if (struct.isSetReverse()) {
        oprot.writeBool(struct.reverse);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, multi_get_request struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot =
          (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(12);
      if (incoming.get(0)) {
        struct.hash_key = new blob();
        struct.hash_key.read(iprot);
        struct.setHash_keyIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list21 =
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.sork_keys = new java.util.ArrayList<blob>(_list21.size);
          blob _elem22;
          for (int _i23 = 0; _i23 < _list21.size; ++_i23) {
            _elem22 = new blob();
            _elem22.read(iprot);
            struct.sork_keys.add(_elem22);
          }
        }
        struct.setSork_keysIsSet(true);
      }
      if (incoming.get(2)) {
        struct.max_kv_count = iprot.readI32();
        struct.setMax_kv_countIsSet(true);
      }
      if (incoming.get(3)) {
        struct.max_kv_size = iprot.readI32();
        struct.setMax_kv_sizeIsSet(true);
      }
      if (incoming.get(4)) {
        struct.no_value = iprot.readBool();
        struct.setNo_valueIsSet(true);
      }
      if (incoming.get(5)) {
        struct.start_sortkey = new blob();
        struct.start_sortkey.read(iprot);
        struct.setStart_sortkeyIsSet(true);
      }
      if (incoming.get(6)) {
        struct.stop_sortkey = new blob();
        struct.stop_sortkey.read(iprot);
        struct.setStop_sortkeyIsSet(true);
      }
      if (incoming.get(7)) {
        struct.start_inclusive = iprot.readBool();
        struct.setStart_inclusiveIsSet(true);
      }
      if (incoming.get(8)) {
        struct.stop_inclusive = iprot.readBool();
        struct.setStop_inclusiveIsSet(true);
      }
      if (incoming.get(9)) {
        struct.sort_key_filter_type = filter_type.findByValue(iprot.readI32());
        struct.setSort_key_filter_typeIsSet(true);
      }
      if (incoming.get(10)) {
        struct.sort_key_filter_pattern = new blob();
        struct.sort_key_filter_pattern.read(iprot);
        struct.setSort_key_filter_patternIsSet(true);
      }
      if (incoming.get(11)) {
        struct.reverse = iprot.readBool();
        struct.setReverseIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(
      org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme())
            ? STANDARD_SCHEME_FACTORY
            : TUPLE_SCHEME_FACTORY)
        .getScheme();
  }
}
